<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuestionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('questions', function (Blueprint $table) {
            $table->increments('id');
            $table->text('question')->comment('题目');
            $table->unsignedInteger('category_id')->default('0')->comment('题库分类 ID');
            $table->unsignedTinyInteger('type')->default('0')->comment('类型');
            $table->unsignedTinyInteger('status')->default('0')->comment('状态');
            $table->string('answer')->default('')->comment('答案');
            $table->text('option_1')->default('')->comment('选项 1');
            $table->text('option_2')->default('')->comment('选项 2');
            $table->text('option_3')->default('')->comment('选项 3');
            $table->text('option_4')->default('')->comment('选项 4');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('questions');
    }
}
